<template>
  <div class="tools">
    <el-row class="animate__animated" :class="visible ? 'animate__fadeInDown' : 'animate__fadeOutUp'">
      <el-button v-if="visible" type="primary" icon="el-icon-edit" circle></el-button>
      <!-- <el-button type="warning" icon="el-icon-check" circle></el-button> -->
      <!-- <el-button type="danger" icon="el-icon-message" circle></el-button> -->
      <el-button v-if="visible" type="success" icon="el-icon-setting" circle></el-button>
      <!-- <el-button type="info" icon="el-icon-rank" circle></el-button> -->
      <el-button v-if="visible" icon="el-icon-arrow-up" circle @click="visible = false"></el-button>
    </el-row>
    <i v-if="!visible" class="el-icon-arrow-down animate__animated" @click="visible = true"
      :class="!visible ? 'animate__fadeInDown' : 'animate__fadeOutUp'"></i>
  </div>
</template>
<script>
export default {
  name: "tools",
  props: {
    /**
     * 确定按钮配置
     */
    confirmButton: {
      type: Object,
      default: () => {
        return {
          text: '确 定',
          class: ''
        }
      }
    },
    /**
     * 取消按钮配置
     */
    cancelButton: {
      type: Object,
      default: () => {
        return {
          text: '取 消',
          class: ''
        }
      }
    },
  },
  data() {
    return {
      visible: false,
    };
  },
  methods: {
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done();
        })
        .catch(_ => { });
    }
  }
};
</script>
<style lang="scss" scoped>
.tools {
  position: absolute;
  left: 50%;
  // margin-top: 12px;
  transform: translate(-50%, 0%);
  user-select: none;

  .el-icon-arrow-down {
    cursor: pointer;
    font-size: 22px;
  }
}
</style>
